function onClickSendEvaluation() {
    var driver = null;
    var car = null;
    var passengers = [];

    if ($("#driver").length) {
        if (myValidatorValidate('driver')) {
            driver = {};
            driver["id_driver"] = driverId;
            driver["courtesy"] = parseInt($("#driverCourtesyField").val());
            driver["punctuality"] = parseInt($("#driverPunctualityField").val());
            driver["driveCarefully"] = parseInt($("#driverDriveCarefullyField").val());
        } else {
            return;
        }
    }

    $('#passengersDiv form').each(function (index) {
        var id = $(this).attr('id');
        if (myValidatorValidate(id)) {
            var read = myValidatorReadFormMap(id);
            var passenger = {};
            passenger["id_passenger"] = parseInt(id);
            passenger["goodHumored"] = read.goodHumored;
            passenger["punctuality"] = read.punctuality;
            passengers.push(passenger);
        } else {
            return;
        }
    });

    if ($("#car").length) {
        if (myValidatorValidate('car')) {
            car = {};
            car["id_car"] = carId;
            car["cleanliness"] = parseInt($("#carCleanlinessField").val());
            car["safety"] = parseInt($("#carSafetyField").val());
            car["conservation"] = parseInt($("#carConservationField").val());
        } else {
            return;
        }
    } else {
        return;
    }
    
    sendEvaluateTrip(tripId, JSON.stringify(car), JSON.stringify(driver), JSON.stringify(passengers), function(data) {
        if(data["success"]) {
            location.href = '/Trabalho_PD/mytrips.html';
        }
    });
}


